@echo off
setlocal
REM 获取当前连接的无线网络名称（只获取第一行 SSID 值）
for /f "tokens=2 delims=:" %%i in ('netsh wlan show interfaces ^| findstr /i "SSID" ^| findstr /v "BSSID"') do set SSID=%%i


REM 去掉可能存在的空格
set SSID=%SSID: =%

REM 判断是否连接到 ChinaTelecom-EDU5.8G 或 China Telecom-EDU2.4G
if "%SSID%"=="ChinaTelecom-EDU5.8G" (
    echo Connected to ChinaTelecom-EDU5.8G, running rz.py...
    python rz.py --type 1
) else if "%SSID%"=="ChinaTelecom-EDU2.4G" (
    echo Connected to China Telecom-EDU2.4G, running rz.py...
    python rz.py --type 1
) else if "%SSID%"=="UESTC-WiFi" (
    echo Connected to UESTC-WiFi, running rz.py...
    python rz.py --type 2
) else if "%SSID%"=="UNICOM-UESTC" (
    echo Connected to UNICOM-UESTC, running rz.py...
    python rz.py --type 3
)
) else (
    echo Not connected to the correct network. Exiting...
    exit /b
)

endlocal
